namespace EyeOpen.DataEntry.Data
{
	public class ShopUnitOfWorkFactory
	{
		private ShopUnitOfWork context;

		public IShopUnitOfWork Create()
		{
			return
				Create<IShopUnitOfWork>();
		}

		public IShopDb GetDb()
		{
			return
				Create<IShopDb>();
		}

		private T Create<T>()
		{
			if (context == null)
			{
				context = new ShopUnitOfWork("ShopConnection");
			}

			return
				(T)(object)context;
		}
	}
}